// index.js
// const app = getApp()
var checkconfig = require("../functions/checkconfig.js");

Page({
  data: {
    powerList: [{
      icon:"../../images/index/egg_list.png",
      background:"rgba(84,112,198,0.3)",
      title: '寄生虫知识表',
      tip: '直接搜索寄生虫名称，获得相关知识',
      url:'/pages/eggs/eggs?pageIndex=1',
      switch:false
    }, {
      icon:"../../images/index/self_check.png",
      background:"	rgba(145,204,117,0.3)",
      title: '症状自查计算',
      tip: '根据症状，系统帮助计算相应寄生虫的发病几率',
      url:'/pages/eggs/eggs?pageIndex=0',
      switch:true
    }, {
      icon:"../../images/index/map.png",
      background:"rgba(18,150,219,0.3)",
      title: '地区情况查询',
      tip: '各地寄生虫的分布及发病情况',
      url:'/pages/map/map',
      switch:true
    }, {
      icon:"../../images/index/danger.png",
      background:"rgba(238,102,102,0.3)",
      title: '高危食物种类',
      tip: '食物可能含有寄生虫的种类，食用方式的风险系数',
      url:'/pages/eggs/eggs?pageIndex=2',
      switch:false
    }],
    switch: false

  },
  async onLoad(options) {
    let flag = await checkconfig.checkconfig()
    console.log(flag)
    this.setData({
      switch: flag
    })
  }
});
